from django.db import models
from notifications.base.models import AbstractNotification

from user.models import UserProfile


class Notification(AbstractNotification):
    customer = models.ForeignKey(UserProfile, on_delete=models.CASCADE, related_name='customer')
    sender = models.ForeignKey(UserProfile, on_delete=models.CASCADE, related_name='sender')

    class Categories(models.TextChoices):
        REPLY = 'REPLY', '评论回复'
        MENTION = 'MENTION', '@我的'
        LIKE = 'LIKE', '收到的赞'
        SYSTEM = 'SYSTEM', '系统通知'
        MY_MESSAGE = 'MY_MESSAGE', '我的消息'
        VIDEO_COMPLAINTS = 'VIDEO_COMPLAINTS', '视频投诉'
        COLUMN_COMPLAINTS = 'COLUMN_COMPLAINTS', '专栏投诉'
        VIDEO_APPEAL = 'VIDEO_APPEAL', '视频申诉'
        COLUMN_APPEAL = 'COLUMN_APPEAL', '专栏申诉'

    root_parent_content = models.TextField('root_parent_content', blank=True, null=True)
    direct_parent_content = models.TextField('direct_parent_content', blank=True, null=True)
    checked = models.BooleanField(default=False)
    category = models.CharField(
        max_length=50,
        choices=Categories.choices,
        default=Categories.SYSTEM
    )

    class Meta(AbstractNotification.Meta):
        abstract = False
